﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace University.Workshop.Presenters.Cistern.Register
{
    public class PresenterRegisterSecondStep
    {
        ISecondStepForRegisterCistern view;

        public PresenterRegisterSecondStep(ISecondStepForRegisterCistern view)
        {
            this.view = view;
        }

        public void UpdateData()
        {
            view.Capacity = view.CisternToRegister.Capacity.ToString();
            view.LicensePlate = view.CisternToRegister.LicencePlate;
            //view.IsActive = view.CisternToRegister.IsActive;
        }

        public void ChargeDataCistern()
        {
            view.CisternToRegister.LicencePlate = view.LicensePlate;
            view.CisternToRegister.Capacity = string.IsNullOrEmpty(view.Capacity)? 0 : Convert.ToInt32(view.Capacity);
        }
    }
}
